<%@ Page Language="C#" MasterPageFile="~/IPMSMasterPage.master" AutoEventWireup="true" 
CodeFile="OptSearchProject.aspx.cs" Inherits="OptSearchProject" Title="Project Monitoring System" 
Culture="Auto:en-US" UICulture="auto" meta:resourcekey="PageResource1" EnableEventValidation="false" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server" Visible="false"/>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" runat="Server">
    <div style="margin-left:10px;margin-right:10px;">
        <cc1:CalendarExtender ID="calStartingNextDueDate" runat="server" TargetControlID="txtStartingNextDueDate" Enabled="True" Format="yyyy-MM-dd"/>
        <cc1:CalendarExtender ID="EndingNextDueDate" runat="server" TargetControlID="txtEndingNextDueDate" Enabled="True" Format="yyyy-MM-dd">
        </cc1:CalendarExtender>
        <asp:TextBox ID="txtUserName" runat="server" Visible="False"></asp:TextBox>
        <asp:Panel ID="Panel2" runat="server" DefaultButton="btnSearch" meta:resourcekey="Panel2Resource1"
            HorizontalAlign="Left">
            <fieldset>
                <legend>
                    <asp:Label ID="lblSearch" runat="server" Text="Search" meta:resourcekey="lblSearchResource1"></asp:Label></legend>
                <table width="800">
                    <tr align="left">
                        <td width="100" align="left">
                            <asp:Label ID="lblProjectGroup" runat="server"  Text="Project Group" meta:resourcekey="lblProjectGroupResource1"/>
                        </td>
                        <td width="150" align="left">
                            <asp:TextBox ID="txtProjectGroup" runat="server" Width="149px"/>
                        </td>
                        <td width="100" align="left">
                            <asp:Label ID="lblProjectCode" runat="server" Text="Project Code" meta:resourcekey="lblProjectCodeResource1"/>
                        </td>
                        <td width="150" align="left">
                            <asp:TextBox ID="txtProject" runat="server" Width="147px" MaxLength="30"/>
                        </td>
                        <td width="150" align="left">
                            <asp:Label ID="lblType" runat="server" Text="Type" meta:resourcekey="lblTypeResource1"/>
                        </td>
                        <td width="150" align="left">
                            <asp:DropDownList ID="ddlType" runat="server" Width="97px" OnPreRender="OnPreRender">
                                <asp:ListItem meta:resourcekey="ListItemResource73"></asp:ListItem>
                                <asp:ListItem meta:resourcekey="ListItemResource74" Text="Patent"></asp:ListItem>
                                <asp:ListItem meta:resourcekey="ListItemResource75" Text="Design"></asp:ListItem>
                                <asp:ListItem meta:resourcekey="ListItemResource76" Text="Trademark"></asp:ListItem>
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr align="left">
                        <td align="left">
                            <asp:Label ID="lblTitleSubject" runat="server" Text="Title/Subject" meta:resourcekey="lblTitleSubjectResource1"/>
                        </td>
                        <td align="left">
                            <asp:TextBox ID="txtTitleSubject" runat="server" Width="150px" MaxLength="60"/>
                        </td>
                        <td align="left">
                            <asp:Label ID="lblCountry" runat="server" Text="Country" meta:resourcekey="lblCountryResource1"/>
                        </td>
                        <td align="left">
                            <asp:DropDownList ID="ddlCountry" width="100px" runat="server" OnPreRender="OnPreRender"/>
                        </td>
                        <td align="left">
                            <asp:Label ID="lblStatus" runat="server" Text="Status" meta:resourcekey="lblStatusResource1"/>
                        </td>
                        <td align="left">
                            <asp:DropDownList ID="ddlStatus" runat="server" OnPreRender="OnPreRender"/>
                        </td>
                    </tr>
                    <tr align="left">
                        <td align="left">
                            <asp:Label ID="lblApplicant" runat="server" Text="Applicant" meta:resourcekey="lblApplicantResource1"/>
                        </td>
                        <td align="left">
                            <asp:TextBox ID="txtApplicant" runat="server" Width="151px" MaxLength="30"/>
                        </td>
                        <td align="left">
                            <asp:Label ID="lblInventor" runat="server" Text="Inventor" meta:resourcekey="lblInventorResource1"/>
                        </td>
                        <td align="left">
                            <asp:TextBox ID="txtInventor" runat="server" MaxLength="30" Width="146px"/>
                        </td>
                        <td align="left">
                            <asp:Label ID="lblResponsiblePerson" runat="server" Text="Responsible Person" meta:resourcekey="lblResponsiblePersonResource1"/>
                        </td>
                        <td align="left">
                            <asp:TextBox ID="txtResponsiblePerson" runat="server" Width="93px" MaxLength="30"/>
                        </td>
                    </tr>
                    <tr align="left">
                        <td align="left">
                            <asp:Label ID="lblAgent" runat="server" Text="Agent" meta:resourcekey="lblAgentResource1"/>
                        </td>
                        <td align="left">
                            <asp:TextBox ID="txtAgent" runat="server"/>
                        </td>
                        <td align="left">
                            <asp:Label ID="lblClient" runat="server" Text="Client" meta:resourcekey="lblClientResource1"/>
                        </td>
                        <td align="left">
                            <asp:TextBox ID="txtClient" runat="server"/>
                        </td>
                        <td align="left">
                            <asp:Label ID="lblProjectClass" runat="server" Text="Project Class"  meta:resourcekey="lblProjectClassResource1" />
                        </td>
                        <td align="left">
                            <asp:DropDownList ID="ddlProjectClass" Width="97px" runat="server" OnPreRender="OnPreRender"/>
                        </td>
                    </tr>
                    <tr align="left">
                        <td align="left">
                            <asp:Label ID="lblNextDueDateFrom" runat="server" Text="Next Due Date" meta:resourcekey="lblNextDueDateFromResource1"></asp:Label>
                        </td>
                        <td align="left">
                            <asp:TextBox ID="txtStartingNextDueDate" runat="server" Width="70px" />
                        </td>
                        <td align="left">
                            <asp:Label ID="lblNextDueDateTo" runat="server" Text="To" meta:resourcekey="lblNextDueDateToResource1"></asp:Label>
                        </td>
                        <td align="left">
                            <asp:TextBox ID="txtEndingNextDueDate" runat="server" Width="92px"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="6" align="center">
                            <asp:Button ID="btnNewProject" Text="New Project" CssClass="submit" meta:resourcekey="btnNewProjectResource1" runat="server" OnClick="OnClick"/>
                            <asp:Button ID="btnSearch" Text="Search" CssClass="submit" meta:resourcekey="btnSearchResource1" runat="server" OnClick="OnClick"/>
                            <asp:Button ID="btnPrintExport" Text="Print/Export" CssClass="submit" meta:resourcekey="btnPrintExportResource1" UseSubmitBehavior="False" runat="server" OnClientClick="javascript:OpenPrint();return false;"/>
                            <asp:Button ID="btnReset" Text="Reset" CssClass="submit" meta:resourcekey="btnResetResource1" UseSubmitBehavior="False" runat="server" OnClientClick="javascript:Reset();return false;"/>
                            <asp:Button ID="btnExport" Text="Export" Visible="false" CssClass="submit" meta:resourceKey="btnExportResource1" runat="server" OnClick="OnClick"/>
                        </td>
                    </tr>
                </table>
            </fieldset>
        </asp:Panel>
		<fieldset>
			<legend>
				<asp:Label ID="lblActive" runat="server" Text="Active Project" meta:resourcekey="lblActiveResource1"></asp:Label>
			</legend>
			<asp:GridView CssClass="Grid" ID="gvResults" runat="server" 
					BackColor="#DEBA84" 
					BorderColor="#660000"
					BorderStyle="Solid" 
					BorderWidth="1px" 
					CellPadding="0" 
					CellSpacing="0" 
					Width="100%"
					Height="1%" 
					AllowPaging="True" 
					PageSize="20" 
					AllowSorting="True" 
					AutoGenerateColumns="False"
					DataKeyNames="ProjectGroupId,ProjectCode,Type,IsDelete" 
					OnRowDataBound="gvResults_RowDataBound"
					OnSelectedIndexChanged="gvResults_SelectedIndexChanged"
					OnRowCommand="gvResults_RowCommand">
				<Columns>
					<asp:BoundField DataField="ProjectCode" HeaderText="Project Code" ItemStyle-Width="100" meta:resourcekey="ButtonFieldResource1"/>
					<asp:BoundField DataField="ProjectGroupId" HeaderText="Project Group" ItemStyle-Width="100" meta:resourcekey="ButtonFieldResource2"/>
					<asp:BoundField DataField="Type" HeaderText="Type" ItemStyle-Width="60" meta:resourcekey="ButtonFieldResource3"/>
					<asp:BoundField DataField="Title" HeaderText="Title/Subject" ItemStyle-Width="100" meta:resourcekey="ButtonFieldResource4"/>
					<asp:BoundField DataField="Country" Visible="false" HeaderText="Country" ReadOnly="True" meta:resourcekey="ButtonFieldResource5"/>
					<asp:BoundField DataField="Status" HeaderText="Status" ItemStyle-Width="60" meta:resourcekey="ButtonFieldResource6"/>
					<asp:BoundField DataField="Applicant" HeaderText="Applicant" ItemStyle-Width="100" meta:resourcekey="ButtonFieldResource7"/>
					<asp:BoundField DataField="Inventor" HeaderText="Inventor" ItemStyle-Width="100" meta:resourcekey="ButtonFieldResource8"/>
					<asp:BoundField DataField="ResponsiblePerson" Visible="false" HeaderText="Responsible Person" ItemStyle-Width="100" ReadOnly="True" meta:resourcekey="ButtonFieldResource9"/>
					<asp:BoundField DataField="Agent" HeaderText="Agent" Visible="false" ReadOnly="True" meta:resourcekey="ButtonFieldResource10"/>
					<asp:BoundField DataField="Client" HeaderText="Client" Visible="false" ReadOnly="True" meta:resourcekey="ButtonFieldResource11"/>
					<asp:BoundField DataField="ProjectClass" Visible="false" HeaderText="Project Class" meta:resourcekey="ButtonFieldResource12"/>
					<asp:BoundField DataField="NextDueDate" Visible="false" HeaderText="Next Due Date" DataFormatString="{0:dd/MM/yyyy}" HtmlEncode="False" ItemStyle-HorizontalAlign="right" meta:resourcekey="ButtonFieldResource13"/>
					<asp:BoundField DataField="Stage" Visible="false" HeaderText="Stage" meta:resourcekey="ButtonFieldResource14"/>
					<asp:BoundField DataField="Remark" Visible="false" HeaderText="Remark" meta:resourcekey="ButtonFieldResource15"/>
					<asp:BoundField DataField="UpdateIP" HeaderText="IP Address" ItemStyle-Width="100" ItemStyle-HorizontalAlign="center" meta:resourcekey="ButtonFieldResource16" />
					<asp:BoundField DataField="UpdateBy" HeaderText="Updated By" ItemStyle-Width="100" ItemStyle-HorizontalAlign="center" meta:resourcekey="ButtonFieldResource17" />
					<asp:BoundField DataField="UpdateDate" HeaderText="Last Update Date" DataFormatString="{0:yyyy-MM-dd HH:mm:ss}" HtmlEncode="False" ItemStyle-Width="160" ItemStyle-HorizontalAlign="center" meta:resourcekey="ButtonFieldResource18" />
					<asp:TemplateField ItemStyle-Width="60" ItemStyle-HorizontalAlign="center" HeaderText="">
						<ItemTemplate>
							<asp:ImageButton ID="lbtnSelect" CommandName="Select" runat="server" ImageUrl="Images/icon-view.jpg" meta:resourcekey="lbtnSelectResource"/>
						</ItemTemplate>
					</asp:TemplateField>
				</Columns>
				<HeaderStyle CssClass="GridHeaderStyle" ForeColor="White" />
				<RowStyle CssClass="GridRowStyle" />
				<AlternatingRowStyle CssClass="GridAltRowStyle" />
				<SelectedRowStyle CssClass="GridSelectedRowStyle" />
				<PagerStyle CssClass="GridPagerStyle" ForeColor="White" />
				<FooterStyle CssClass="GridFooterStyle" />
			</asp:GridView>
		</fieldset>
		<asp:Panel id="pnlProjectDel" runat="server">
			<fieldset>
				<legend>
					<asp:Label ID="lblDeleted" runat="server" Text="Deleted Project" meta:resourcekey="lblDeletedResource1"></asp:Label>
				</legend>
				<asp:GridView CssClass="Grid" ID="gvProjectDeleteList" runat="server" 
						BackColor="#DEBA84"
						BorderColor="#660000" 
						BorderStyle="Solid" 
						BorderWidth="1px" 
						CellPadding="0" 
						CellSpacing="0"
						Width="100%" 
						Height="1%" 
						AllowPaging="True" 
						PageSize="20" 
						AllowSorting="True"
						AutoGenerateColumns="False" 
						OnRowDataBound="gvProjectDeleteList_RowDataBound" 
						DataKeyNames="ProjectGroupId,ProjectCode,Type,IsDelete"
						OnRowCommand="gvProjectDeleteList_RowCommand">
					<Columns>
						<asp:BoundField DataField="ProjectCode" HeaderText="Project Code" ItemStyle-Width="100" meta:resourcekey="ButtonFieldResource19"/>
						<asp:BoundField DataField="ProjectGroupId" HeaderText="Project Group" ItemStyle-Width="100" meta:resourcekey="ButtonFieldResource20"/>
						<asp:BoundField DataField="Type" HeaderText="Type" ItemStyle-Width="60" meta:resourcekey="ButtonFieldResource21"/>
						<asp:BoundField DataField="Title" HeaderText="Title/Subject" ItemStyle-Width="100" meta:resourcekey="ButtonFieldResource22"/>
						<asp:BoundField DataField="Country" Visible="false" HeaderText="Country" ReadOnly="True" ItemStyle-HorizontalAlign="Left" meta:resourcekey="ButtonFieldResource23" />
						<asp:BoundField DataField="Status" HeaderText="Status" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="10%" ItemStyle-Wrap="false" meta:resourcekey="ButtonFieldResource24" />
						<asp:BoundField DataField="Applicant" HeaderText="Applicant" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="15%" ItemStyle-Wrap="false" meta:resourcekey="ButtonFieldResource25" />
						<asp:BoundField DataField="Inventor" HeaderText="Inventor" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="15%" ItemStyle-Wrap="false" meta:resourcekey="ButtonFieldResource26" />
						<asp:BoundField DataField="ResponsiblePerson" Visible="false" HeaderText="Responsible Person" ItemStyle-HorizontalAlign="Left" ItemStyle-Wrap="false" ReadOnly="True" meta:resourcekey="ButtonFieldResource27" />
						<asp:BoundField DataField="Agent" HeaderText="Agent" Visible="false" ReadOnly="True" ItemStyle-HorizontalAlign="Left" meta:resourcekey="ButtonFieldResource28" />
						<asp:BoundField DataField="Client" HeaderText="Client" Visible="false" ReadOnly="True" ItemStyle-HorizontalAlign="Left" meta:resourcekey="ButtonFieldResource29" />
						<asp:BoundField DataField="ProjectClass" Visible="false" HeaderText="Project Class" ItemStyle-HorizontalAlign="Left" ItemStyle-Wrap="false" meta:resourcekey="ButtonFieldResource30" />
						<asp:BoundField DataField="NextDueDate" Visible="false" HeaderText="Next Due Date" ItemStyle-HorizontalAlign="Right" DataFormatString="{0:dd/MM/yyyy}" HtmlEncode="False" meta:resourcekey="ButtonFieldResource31" />
						<asp:BoundField DataField="Stage" Visible="false" HeaderText="Stage" ItemStyle-HorizontalAlign="Left" ItemStyle-Wrap="false" meta:resourcekey="ButtonFieldResource32" />
						<asp:BoundField DataField="Remark" Visible="false" HeaderText="Remark" ItemStyle-HorizontalAlign="Left" ItemStyle-Wrap="false" meta:resourcekey="ButtonFieldResource33" />
						<asp:BoundField DataField="DeleteIP" HeaderText="IP Address" ItemStyle-HorizontalAlign="left" meta:resourcekey="ButtonFieldResource34" />
						<asp:BoundField DataField="DeleteBy" HeaderText="Deleted By" ItemStyle-HorizontalAlign="left" meta:resourcekey="ButtonFieldResource35" />
						<asp:BoundField DataField="DeleteDate" HeaderText="Delete Date" ItemStyle-HorizontalAlign="left" meta:resourcekey="ButtonFieldResource36" />
						<asp:TemplateField ItemStyle-Width="60" ItemStyle-HorizontalAlign="center" HeaderText="">
							<ItemTemplate>
								<asp:ImageButton ID="lbtnRestore" CommandName="Restore" runat="server" ImageUrl="Images/icon-restore.jpg"/>
								<asp:ImageButton ID="lbtnFroceDelete" CommandName="ForceDelete" runat="server" ImageUrl="Images/icon-trash.gif"/>
							</ItemTemplate>
						</asp:TemplateField>
					</Columns>
					<HeaderStyle CssClass="GridHeaderStyle" ForeColor="White" />
					<RowStyle CssClass="GridRowStyle" />
					<AlternatingRowStyle CssClass="GridAltRowStyle" />
					<SelectedRowStyle CssClass="GridSelectedRowStyle" />
					<PagerStyle CssClass="GridPagerStyle" ForeColor="White" />
					<FooterStyle CssClass="GridFooterStyle" />
				</asp:GridView>
			</fieldset>
        </asp:Panel>
    </div>
</asp:Content>
